import React, { Component } from 'react';
import EventBus from '../../util/eventbus';

interface Iprops{
    children:any,
    defaultSelectedKeys:string[],   //控制高亮
    defaultOpenKeys:string[],        //控制显示和隐藏
    onClick:any
}

class Menu extends Component<Iprops> {
    componentDidMount(){
        console.log(this.props.defaultOpenKeys,"defaultOpenKeys")
        EventBus.$emit('open',this.props.defaultOpenKeys);
        EventBus.$emit('active',this.props.defaultSelectedKeys,this.props.onClick);
    }
    render() {
        return (
            <div>
                {this.props.children}
            </div>
        );
    }
}

export default Menu;